<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=yes">
<meta charset="utf8">

<div id="host"> </div>
<!-- todo 去除外部标签，只保留script内容，编译为settings.js文件 -->
<script src='MdbR/settings.js'></script>
<script src='http://192.168.0.100:8080/base/3/MdbR/settings.js'></script>
<body>
    <script>
        // 测试
        if(true) {
            function debug(...e){console.log(e)};
            var host = document.getElementById('host');
            var settingsJson = {
                todo1 : true
                ,todo2 : true
                ,schWho : 1
                ,sch1 : false
                ,sch2 : true
                ,sch3 : false
            };

            function pref(id, value, el) 
            {
                settingsJson[id] = value;

                debug('pref_id=', id, 'newValue=', typeof value, value, 'result=');
                
                console.log(value);

                console.log(settingsJson);

                return 1;
            }

            var settings = ['首选项'
                , [1, 'todo1', ['提醒待办事项一'], settingsJson.todo1]
                , [1, 'todo2', ['提醒待办事项二'], settingsJson.todo2]
                , [1|1<<10, ['sch1','schWho', 0,settingsJson.schWho==0], ['千搜', '使用镜像站点:'], settingsJson.sch1]
                , [1|1<<10, ['sch2','schWho', 1,settingsJson.schWho==1], ['万应', '使用镜像站点:'], settingsJson.sch2]
                , [1|1<<10, ['sch3','schWho', 2,settingsJson.schWho==2], ['川息', '使用镜像站点:'], settingsJson.sch3]
            ];

            SettingsBuildCard(pref, settings, host);
        }
    </script>
</body>